export const enumeratFn = {
  getEnumerationName: (type, code) => {
    const list = enumeration[type] || []
    const item = list.find(v => v.code == code)
    return item ? item.name : ''
  },
  getEnumerationkey: (type, name) => {
    const list = enumeration[type] || []
    const item = list.find(v => v.name == name)
    return item ? item.code : ''
  },
  getEnumerationList: (v) => {
    return enumeration[v] || []
  },
  // 获取枚举项
  getEnumerationItem(type, code) {
    var obj = {}
    enumeration[type].forEach((item, index) => {
      if (item.code == code) {
        obj = { ...item, index: index }
      }
    })
    return obj
  }
}
const enumeration = {
  // 订单状态
  orderStatus: [
    { name: '订单无效', code: '-99' },
    { name: '订单关闭', code: '-1' },
    { name: '待付款', code: '0' },
    { name: '待服务', code: '1' },
    { name: '服务中', code: '2' },
    { name: '退款中', code: '3' },
    { name: '退款成功', code: '4' },
    { name: '拒绝退款', code: '5' },
    { name: '已完成', code: '6' },
    { name: '待确认', code: '7' },
    { name: '退款失败', code: '8' }
  ]

}
// 订单列表头部状态
export const ORDERTABSTUS =
[
  { name: '全部', code: '' },
  { name: '待付款', code: '0' },
  { name: '待使用/收货', code: '1' },
  { name: '退款/售后', code: '2' },
  { name: '已完成', code: '3' }
]

